<template>
    <div>
        <!-- 附件 -->
        <template>
            <div class="gcontent">
                <Row class="form_left " style="margin-bottom: 10px;" v-if="!ifedit">
                    <Col span="5">
                        <component ref="fileModal" :is="'fileModal'" :filesList="filesList" ></component>
                    </Col>
                    <Col span="10">
                        <component ref="fileUpload" :is="'fileUpload'" v-model="files"></component>
                    </Col>
                </Row>
                <Row v-else>
                    <component ref="fileDownload" :is="'fileDownload'" :files="files"></component>
                </Row>
            </div>
        </template>
    </div>
</template>
<script>
    import fileUpload from '../../../base/file_uploader'
    import fileModal from '../../../base/file_modal'
    import fileDownload from '../../../base/file_download'

    export default {
        components:{
           fileUpload,fileModal,fileDownload
        },
        data () {
            return {

            }
        },
        methods: {
            getFiles(){
                // if(!this.ifedit){
                //     return this.$refs.fileUpload.applyinfo.files
                // }else {
                // }
                    return this.Papply.files
            }
        },
        props: {
            ifedit: {},
            Papply: {},
            filesList:{},
            value: {
              default:Array
            },
        },
        computed: {
          files: {
            get: function() {
              if(this.value == undefined || this.value == null){
                this.$emit('input', []);
                return []
              }else{
                return this.value;
              }
            },
            set: function(value) {
              this.$emit('input', value);
            }
          },
        },
    }
</script>
